package com.gym.model.entity;

public class User {

	private int id;
	private boolean disabled;
	private String email;
	private String password;
	private short role;

	public User(int id, boolean disabled, String email, String password, short role) {
		super();
		this.id = id;
		this.disabled = disabled;
		this.email = email;
		this.password = password;
		this.role = role;
	}

	public User(String email, String password) {  //COSTRUTTORE PER LA REGISTRAZIONE
		super();
		this.email = email;
		this.password = password;
	}

	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public short getRole() {
		return role;
	}

	
	public boolean isCustomer() {
		return (role == 0);
	}
	
	public boolean isAdmin() {
		return (role == 1);
	}
	
	
	@Override
	public String toString() {
		return "user [id=" + id + ", disabled=" + disabled + ", email=" + email
				+ ", password=" + password + ", role=" + role + "]";
	}
}
